-- cure_mon
-- create by xinj
-- 技能: 怪物恢复目标总生命值，根据威力和攻击计算


return {
    apply = function(source, target, skillId, round, para, extra)
        -- 1. 威力
        local force = para[1];

        -- 2. 施展方的魔力
        local attack = source:getAttack();

        -- 3. 作用
        local hp = math.modf(force * attack / 1000);

        CombatM.receiveCure(source, target, hp);

        -- 作用目标
        return { target, };
    end,

    parse = function(desc)
        local arr = string.explode(desc, ",");
        return { tonumber(arr[1]), };
    end,

    -- 解析技能描述
    parseDesc = function(source, skillId, desc, para)
        -- 1. 威力
        local force = para[1];

        -- 最终威力
        local prop = PropM.combine(source, "magic_effect", skillId);
        force = force + PropM.apply(prop, force);

--        -- 某系技能威力加成
--        prop = PropM.combine(source, "magic_effect_style", SkillM.query(skillId, "style"));
--        force = PropM.apply(prop, force);
--
--        -- 恢复类魔法效果加成
--        prop = PropM.combine(source, "magic_effect_style", "cure");
--        force = PropM.apply(prop, force);

        -- 2. 施展方的魔力
        local magic = source:getMagic();

        -- 3. 作用/计算时魔力+3
        local hp = math.modf(force * (magic + 3) / 1000);

        desc = string.gsub(desc, "{cure}", hp);

        return desc;
    end,
}

